package com.spundhan.xtrac;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;

public class ExpensesActivity extends Activity {

	Spinner tripsSpinner,currencySpinner,categorySpinner,subCatSpinner;
	
	Button btnDate;
	
	EditText editAmount;
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_expenses);
		
		
		Button btnDate = (Button) findViewById(R.id.btn_date);
		
		initLayout();
		
		btnDate.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {

				Intent i = new Intent();
				i.setClassName("com.android.calculator2",
				               "com.android.calculator2.Calculator");
				startActivity(i); 
				
			}
		});
		
//		Spinner spinner2 = (Spinner) findViewById(R.id.spinner);
//		List<String> list = new ArrayList<String>();
//		list.add("list 1");
//		list.add("list 2");
//		list.add("list 3");
//		ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,
//			android.R.layout.simple_spinner_item, list);
//		dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_item);
//		spinner2.setAdapter(dataAdapter);
	}

	private void initLayout() {

		tripsSpinner = (Spinner) findViewById(R.id.spinner_trips);
		btnDate = (Button) findViewById(R.id.btn_date);
		editAmount = (EditText) findViewById(R.id.edit_amount);
		currencySpinner = (Spinner) findViewById(R.id.spinner_currency);
		categorySpinner = (Spinner) findViewById(R.id.spinner_category);
		subCatSpinner = (Spinner) findViewById(R.id.spinner_subcat);
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.expenses, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
}
